﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using web.data.entities;
using web.bussines;
using Webdiyer.WebControls.Mvc;

namespace web.core.Models
{
    public class h_contentModels
    {
        public static PagedList<employee_family> getEmployeeFamilyBuilder(int pageindex, int pagesite, string text_search, string hometown, string current_address, string job, string birth_day, ref int total_record)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getEmployeeFamilyBuilder(pageindex, pagesite, text_search, hometown, current_address, job, birth_day, ref total_record);
        }
        //Bat dau contenModels Thuy lam 
        /// <summary>
        /// 
        /// </summary>
        /// <param name="pageindex"></param>
        /// <returns></returns>
        public static PagedList<school> getSchoolBuilder(int pageindex, int pagesite, string text_search)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getSchoolBuilder(pageindex, pagesite, text_search);
        }

        public static school getSchoolByID(int id)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getSchoolByID(id);
        }


        public static void editSchool(school school)
        {
            h_content_service accSvc = new h_content_service();
            accSvc.editSchool(school);
        }
        public static int createSchool(school school)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.createSchool(school);
        }

        /// <summary>
        /// object employee
        /// </summary>
        /// <param name="pageindex"></param>
        /// <param name="pagesite"></param>
        /// <param name="text_search"></param>
        /// <param name="parent"></param>
        /// <returns></returns>
        public static PagedList<object_employee> getobject_employeeBuilder(int pageindex, int pagesite, string text_search, int? parent)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getobject_employeeBuilder(pageindex, pagesite, text_search, parent);
        }
        public static List<object_employee> getListobject_employeeByParent(int? id)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getListobject_employeeByParent(id);
        }
        public static List<object_employee> getListobject_employeeBuilder(int? id)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getListobject_employeeBuilder(id);
        }

        public static object_employee getObjectEmployeeByID(int id)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getObjectEmployeeByID(id);
        }
        public static void editObjectEmployee(object_employee object_employee)
        {
            h_content_service accSvc = new h_content_service();
            accSvc.editObjectEmployee(object_employee);
        }
        public static int createObjectEmployee(object_employee object_employee)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.createObjectEmployee(object_employee);
        }

        /// <summary>
        /// employee_foreign_countries
        /// </summary>
        /// <param name="pageindex"></param>
        /// <param name="pagesite"></param>
        /// <param name="text_search"></param>
        /// <returns></returns>
        public static PagedList<employee_foreign_countries> getemployee_foreign_countriesBuilder(int pageindex, int pagesite, int? employeeId, string text_search)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getemployee_foreign_countriesBuilder(pageindex, pagesite, employeeId, text_search);
        }


        public static employee getemployeeByID(int id)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getemployeeByID(id);
        }

        public static List<employee> getListemployee()
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getListemployee();
        }
        public static void editEmployeeForeignCountries(employee_foreign_countries employee_foreign_country)
        {
            h_content_service accSvc = new h_content_service();
            accSvc.editEmployeeForeignCountries(employee_foreign_country);
        }
        public static int createEmployeeForeignCountries(employee_foreign_countries employee_foreign_country)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.createEmployeeForeignCountries(employee_foreign_country);
        }
        public static List<employee> listemployee()
        {
            h_content_service conSvc = new h_content_service();

            return conSvc.listemployee();
        }


        public static employee_foreign_countries getEmployeeForeignCountriesByID(int id)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getEmployeeForeignCountriesByID(id);
        }

        /// <summary>
        /// employee_school
        /// </summary>
        /// <param name="pageindex"></param>
        /// <param name="pagesite"></param>
        /// <param name="text_search"></param>
        /// <returns></returns>

        public static void editEmployeeSchool(employee_school employee_school)
        {
            h_content_service accSvc = new h_content_service();
            accSvc.editEmployeeSchool(employee_school);
        }
        public static int createEmployeeSchool(employee_school employee_school)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.createEmployeeSchool(employee_school);
        }

        public static employee_school getEmployeeSchoolByID(int id)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getEmployeeSchoolByID(id);
        }
        public static List<school> getListSchool()
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getListSchool();
        }
        public static List<school> listschool()
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.listschool();
        }

        //
        /// <summary>
        /// tbl_leave_manage
        /// </summary>
        /// <param name="pageindex"></param>
        /// <param name="pagesite"></param>
        /// <param name="text_search"></param>
        /// <returns></returns>

        public static void editLeaveManage(leave_manage leave_manage)
        {
            h_content_service accSvc = new h_content_service();
            accSvc.editLeaveManage(leave_manage);
        }
        public static int createLeaveManage(leave_manage leave_manage)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.createLeaveManage(leave_manage);
        }

        public static leave_manage getLeaveManageByID(int id)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getLeaveManageByID(id);
        }
        public static List<type_leave> getListtype_leave()
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getListtype_leave();
        }
        public static List<type_leave> listtype_leave()
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.listtype_leave();
        }
        public static PagedList<leave_manage> getleave_manageBuilder(int pageindex, int pagesite, int employeeId, string text_search)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getleave_manageBuilder(pageindex, pagesite, employeeId, text_search);
        }


        ///
        /// <summary>
        /// employee_visa_passport
        /// </summary>
        /// <param name="pageindex"></param>
        /// <param name="pagesite"></param>
        /// <param name="text_search"></param>
        /// <returns></returns>
        public static PagedList<employee_visa_passport> getemployee_visa_passportBuilder(int pageindex, int pagesite, int? employeeId, string text_search)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getemployee_visa_passportBuilder(pageindex, pagesite, employeeId, text_search);
        }

        public static void editEmployeeVisaPassport(employee_visa_passport employee_visa_passport)
        {
            h_content_service accSvc = new h_content_service();
            accSvc.editEmployeeVisaPassport(employee_visa_passport);
        }
        public static int createEmployeeVisaPassport(employee_visa_passport employee_visa_passport)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.createEmployeeVisaPassport(employee_visa_passport);
        }


        public static employee_visa_passport getEmployeeVisaPassportByID(int id)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getEmployeeVisaPassportByID(id);
        }

        public static PagedList<leave_manage> getleave_manageBuilder(int pageindex, int pagesite, int? employeeId, string text_search)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getleave_manageBuilder(pageindex, pagesite, employeeId, text_search);
        }

        //Ket thuc contentModels thuy lam
        public static PagedList<type_contract> getPagerTypeContract(int pageindex, int pagesite, string text_search)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getPagerTypeContract(pageindex, pagesite, text_search);
        }
        public static type_contract getTypeContractByID(int id)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getTypeContractByID(id);
        }
        public static int createTypeContract(type_contract type_contract)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.createTypeContract(type_contract);
        }
        public static void editTypeContract(type_contract type_contract)
        {
            h_content_service conSvc = new h_content_service();
            conSvc.editTypeContract(type_contract);
        }

        //Cơ sở ( chi nhánh )
        //public static PagedList<branch> getPagerBranch(int pageindex, int pagesite, string text_search)
        //{
        //    h_content_service conSvc = new h_content_service();
        //    return conSvc.getPagerBranch(pageindex, pagesite, text_search);
        //}
        //public static branch getBranchByID(int id)
        //{
        //    h_content_service conSvc = new h_content_service();
        //    return conSvc.getBranchByID(id);
        //}
        //public static int createBranch(branch branch)
        //{
        //    h_content_service conSvc = new h_content_service();
        //    return conSvc.createBranch(branch);
        //}
        //public static void editBranch(branch branch)
        //{
        //    h_content_service conSvc = new h_content_service();
        //    conSvc.editBranch(branch);
        //}


        //Các loại hình nghỉ
        public static PagedList<type_leave> getPagerTypeLeave(int pageindex, int pagesite, string text_search)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getPagerTypeLeave(pageindex, pagesite, text_search);
        }
        public static type_leave getTypeLeaveByID(int id)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getTypeLeaveByID(id);
        }
        public static int createTypeLeave(type_leave type_leave)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.createTypeLeave(type_leave);
        }
        public static void editTypeLeave(type_leave type_leave)
        {
            h_content_service conSvc = new h_content_service();
            conSvc.editTypeLeave(type_leave);
        }

        //Tạo thân nhân 
        public static int createEmployeeFamily(employee_family employee_family)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.createEmployeeFamily(employee_family);
        }
        //Sửa thân nhân
        public static employee_family getEmployeeFamilyByID(int id)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getEmployeeFamilyByID(id);
        }
        public static void editEmployeeFamily(employee_family employee_family)
        {
            h_content_service conSvc = new h_content_service();
            conSvc.editEmployeeFamily(employee_family);
        }

        //Tạo hồ sơ nhà đất
        //public static int createEmployeeHouseLand(employee_house_land employee_house_land)
        //{
        //    h_content_service conSvc = new h_content_service();
        //    return conSvc.createEmployeeHouseLand(employee_house_land);
        //}
        ////Sửa hồ sơ nhà đất
        //public static employee_house_land getEmployeeHouseLandByID(int id)
        //{
        //    h_content_service conSvc = new h_content_service();
        //    return conSvc.getEmployeeHouseLandByID(id);
        //}
        //public static void editEmployeeHouseLand(employee_house_land employee_house_land)
        //{
        //    h_content_service conSvc = new h_content_service();
        //    conSvc.editEmployeeHouseLand(employee_house_land);
        //}

        //Tạo hồ sơ bảo hiểm
        public static int createEmployeeInsurance(employee_insurance employee_insurance)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.createEmployeeInsurance(employee_insurance);
        }
        //Sửa hồ sơ bảo hiểm
        public static employee_insurance getEmployeeInsuranceByID(int id)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getEmployeeInsuranceByID(id);
        }
        public static void editEmployeeInsurance(employee_insurance employee_insurance)
        {
            h_content_service conSvc = new h_content_service();
            conSvc.editEmployeeInsurance(employee_insurance);
        }

        //Tạo hồ sơ luân chuyển --> Hiện nay (Tạo hồ sơ công tác)
        public static int createEmployeeRotation(employee_rotation employee_rotation)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.createEmployeeRotation(employee_rotation);
        }
        //Cập nhật hồ sơ luân chuyển --> Hiện nay (cập nhật hồ sơ công tác)
        public static employee_rotation getEmployeeRotationByID(int id)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getEmployeeRotationByID(id);
        }
        public static void editEmployeeRotation(employee_rotation employee_rotation)
        {
            h_content_service conSvc = new h_content_service();
            conSvc.editEmployeeRotation(employee_rotation);
        }

        //Tạo hồ sơ 
        public static int createEmployee(employee employee)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.createEmployee(employee);
        }

        public static List<departments> getListDepartment()
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getListDepartment();
        }

        public static List<object_employee> getListObjEmployee()
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getListObjEmployee();
        }
        //Sửa hồ sơ

        public static employee getEmployeeByID(int id)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getEmployeeByID(id);
        }
        public static void editEmployee(employee employee)
        {
            h_content_service conSvc = new h_content_service();
            conSvc.editEmployee(employee);
        }

        //Tạo hợp đồng
        public static int createContract(contract contract)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.createContract(contract);
        }

        public static List<type_contract> getListTypeContract()
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getListTypeContract();
        }
        //Sửa hợp đồng
        public static contract getContractByID(int id)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getContractByID(id);
        }
        public static void edit_employee_contract(contract contract)
        {
            h_content_service conSvc = new h_content_service();
            conSvc.edit_employee_contract(contract);
        }
       //Tạo hồ sơ sức khỏe
        public static int createMedicalRecord(employee_medical_records medicalRecord)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.createMedicalRecord(medicalRecord);
        }
        //Cập nhật hồ sơ sức khỏe
        public static employee_medical_records getMedicalRecordByID(int id)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getMedicalRecordByID(id);
        }
        public static void edit_employee_medical_record(employee_medical_records medicalRecord)
        {
            h_content_service conSvc = new h_content_service();
            conSvc.edit_employee_medical_record(medicalRecord);
        }

        //Tạo hồ sơ nghỉ việc
        public static int createJobSeverance(employee_job_severance jobSeverance)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.createJobSeverance(jobSeverance);
        }
        //Cập nhật hồ sơ nghỉ việc
        public static employee_job_severance getJobSeveranceByID(int id)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getJobSeveranceByID(id);
        }
        public static void edit_employee_jobSeverance(employee_job_severance jobSeverance)
        {
            h_content_service conSvc = new h_content_service();
            conSvc.edit_employee_jobSeverance(jobSeverance);
        }
       
       //Danh sach ky luat
        public static PagedList<reward> getPagerDiscripline(int pageindex, int pagesite, string text_search,DateTime? from_date, DateTime? to_date)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getPagerDiscripline(pageindex, pagesite, text_search, from_date,  to_date);
        }
        public static List<reward> getPagerDiscriplineExport(string text_search, int? years, DateTime? from_date, DateTime? to_date)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getPagerDiscriplineExport(text_search, years, from_date, to_date);
        }
        public static reward getDiscriplinedByID(int id)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getDiscriplinedByID(id);
        }
        //Tạo danh sách kỷ luật
        public static int createDiscripline(reward discripline)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.createDiscripline(discripline);
        }
        //Cập nhật danh sách kỷ luật
        public static void edit_discripline(reward discripline)
        {
            h_content_service conSvc = new h_content_service();
            conSvc.edit_Discripline(discripline);
        }

        //Danh sach huân huy chương cho cá nhân
        public static PagedList<reward> getPagerMedals(int pageindex, int pagesite, string text_search,int? years,DateTime? from_date, DateTime? to_date)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getPagerMedals(pageindex, pagesite, text_search, years,from_date,to_date);
        }
        public static List<reward> getPagerMedalsCNExport(string text_search, int? years,DateTime? from_date, DateTime? to_date)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getPagerMedalsCNExport(text_search, years,from_date,to_date);
        }
        public static List<reward> getPagerMedalsTTExport(string text_search, int? years, DateTime? from_date, DateTime? to_date)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getPagerMedalsTTExport(text_search, years,from_date,to_date);
        }
        
        
        public static reward getMedalsByID(int id)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getMedalsByID(id);
        }
        public static List<int> getListYears()
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getListYears();
        }
        public static List<int> getListYearsGroup()
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getListYearsGroup();
        }
        public static void edit_medals(reward medals)
        {
            h_content_service conSvc = new h_content_service();
            conSvc.edit_Medals(medals);
        }
        // Danh sách tặng huân huy chương cho tập thể
        public static PagedList<reward> getPagerMedalsGroup(int pageindex, int pagesite, string text_search, int? years, DateTime? from_date, DateTime? to_date)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getPagerMedalsGroup(pageindex, pagesite, text_search, years,from_date,to_date);
        }
        //Tạo huân huy chương
        public static int createMedals(reward medals)
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.createMedals(medals);
        }
        public static List<employee> getListEmployees()
        {
            h_content_service conSvc = new h_content_service();
            return conSvc.getListEmployees();
        }
        public static List<employee> getListEmployeesBirthday()
                {
                    h_content_service conSvc = new h_content_service();
                    return conSvc.getListEmployeesBirthday();
                }
        public static void deleteMedals(int reward_id)
        {
            h_content_service conSvc = new h_content_service();
            conSvc.deleteMedals(reward_id);
        }
        // Tao loại huân huy chương

        public static PagedList<type_reward> getTypeRewardBuilder(int pageindex, int pagesite, string text_search, int? parent)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getTypeRewdBuilder(pageindex, pagesite, text_search, parent);
        }
        public static List<type_reward> getListTypeRewardByParent(int? id)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getListTypeRewardByParent(id);
        }
       public static List<type_reward> getListTypeRewardBuilder(int? id)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getListTypeRewardBuilder(id);
        }


        public static type_reward getTypeRewardByID(int id)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getTypRewardByID(id);
        }
        public static void editTypeReward(type_reward type_reward)
        {
            h_content_service accSvc = new h_content_service();
            accSvc.editTypReward(type_reward);
        }
        public static int createTypeReward(type_reward type_reward)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.createTypReward(type_reward);
        }
        public static int createReward(reward reward)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.createReward(reward);
        }
        public static void edit_reward(reward reward)
        {
            h_content_service conSvc = new h_content_service();
            conSvc.editReward(reward);
        }
        public static reward getRewardByID(int id)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getRewardByID(id);
        }
        // Tao danh sach phong ban

        public static PagedList<departments> getDepartmentsBuilder(int pageindex, int pagesite, string text_search, int? parent)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getDepartmentsBuilder(pageindex, pagesite, text_search, parent);
        }
        public static List<departments> getListDepartmentsByParent(int? id)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getListDepartmentsByParent(id);
        }
        public static List<departments> getListDepartmentsBuilder(int? id)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getListDepartmentsBuilder(id);
        }

        public static departments getDepartmentsByID(int id)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getDepartmentsByID(id);
        }

        public static int createDepartments(departments departments)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.createDepartment(departments);
        }
        public static void editDepartments(departments departments)
        {
            h_content_service accSvc = new h_content_service();
            accSvc.editDepartments(departments);
        }
        public static void addDepartmentEmployee(int departments_id, int employee_id)
        {
            h_content_service deSvc = new h_content_service();
            deSvc.addDepartmentEmployee(departments_id, employee_id);
        }
        public static void deleteDepartmentEmployee(int employee_id)
        {
            h_content_service deSvc = new h_content_service();
            deSvc.deleteDepartmentEmployee(employee_id);
        }
        public static List<int> getListDepartmentEmployee(int employee_id)
        {
            h_content_service accSvc = new h_content_service();
            return accSvc.getListDepartmentEmployee(employee_id);
        }
    }
}